package com.qzw.util;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class Utils {private  static Configuration configuration;
    private  static SessionFactory sessionFactory;
    static {
        Configuration configure = new Configuration().configure();
        sessionFactory  = configure.buildSessionFactory();

    }
    public static SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    public static Session getSession(){
        return sessionFactory.getCurrentSession();
    }
    public static void main(String[] args) {

    }
}
